#OPTIMIZATION=-O3 -march=i686 -fno-rtti --param max-inline-insns-single=180 --param max-inline-insns-auto=120
OPTIMIZATION=-O3 -march=i686 -fno-rtti 
#-Winline --param inline-unit-growth=200
CXX=C:/mingw/bin/g++
LINKER=$(CXX) -static-libgcc
FLAGS=-mwindows

#-frepo: smart template instantation
# (max-inline-insns-single (300), max-inline-insns (600), max-inline-slope (32), min-inline-insns (130)), which are also documented.

#todo: -msse2 
STRIPPING=-Wl,-s

ifeq (1,debug)
	OPTIMIZATION+=-g
	STRIPPING=
endif

VERSION=$(word 1, $(shell version.bat) )

CPPFLAGS=$(FLAGS) $(OPTIMIZATION) -I tyle -I ../tyle/trunk/src -I c:/mingw/include -DGCC_NEW

#-DMEMDEBUG

OBJECTS=tyledHttp app thResource
PRJ=tyledHttp
OUT=out
OPRJ=$(PRJ)

vpath ../shared ../tyle $(OUT)

myHttp.exe: $(OBJECTS:%=%.o)
	$(LINKER)  $^ $(FLAGS) -o $(OPRJ) $(STRIPPING) -Wl,--enable-stdcall-fixup -l ws2_32 -Ltyle -ltyle

%.o: %.cc
	$(CXX) -c $(CPPFLAGS) $< -o $@
	
thResource.o: thResource.rc
	windres -i $< -o $@

.PHONY: clean
clean:
	rm -f *.o

